#include "buffer.hpp"

int main()
{
    // Buffer buf;
    // std::string writer("Hello!!!");
    // buf.WriteStringAndPush(writer);

    // Buffer buf1;
    // buf1.WriteAndPush("111", 3);

    // buf.WriteBufferAndPush(buf1);

    // std::string tmp;
    // tmp = buf.ReadStringAndPop(buf.ReadableSpace());

    // std::cout << "string缓冲区内容: " << tmp << std::endl;
    // std::cout << "Buffer里剩余可读内容数据: " << buf.ReadableSpace() << std::endl;
    // std::cout << "Buffer1里剩余可读内容数据: " << buf1.ReadableSpace() << std::endl;

    Buffer buf;
    for(int i = 0; i < 300; i++)
    {
        std::string str = "BufferNo:->" + std::to_string(i) + "\n";
        buf.WriteStringAndPush(str);
    }

    while(buf.ReadableSpace() > 0)
    {
        std::string line = buf.GetLineAndPop();
        // cout << line << endl;
        INF_LOG("%s", line.c_str());
    }
    DBG_LOG("Test Log");
    std::string str;
    str = buf.ReadStringAndPop(buf.ReadableSpace());
    // cout << str << endl;
    return 0;
}